/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.rooms;

import bllInterface.iRoomListener;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import javax.swing.event.ListDataListener;

/**
 *
 * @author Mrkupi
 */
public class RoomListenerImpl extends UnicastRemoteObject implements iRoomListener
{
    private RoomChatModel model = new RoomChatModel();
    
    public RoomListenerImpl() throws RemoteException
    {
    }
    
    public void addListListener(ListDataListener listener)
    {
        model.addListDataListener(listener);
    }
    
    @Override
    public void add(String roomName) throws RemoteException 
    {
        model.addRoom(roomName);
    }

    @Override
    public void remove(String roomName) throws RemoteException 
    {
    }

    @Override
    public void addAll(ArrayList<String> roomNames) throws RemoteException 
    {
        for(int i = 0; i < roomNames.size(); ++i)
        {
            model.addRoom(roomNames.get(i));
        }
    }
}